[ROCm][Perf] Split MiniMax-M3 prefill index-score K loop - #52059
Open
akii96 wants to merge 1 commit into
Open
Conversation
akii96
force-pushed
the
perf/minimax-m3-index-score-split-k
branch
from
August 13, 2026 04:02
96795ce to
3ac7f01
Compare
akii96
marked this pull request as ready for review
August 13, 2026 04:13
akii96
requested review from
AndreasKaratzas,
WoosukKwon,
dllehr-amd,
hongxiayang,
mgoin,
tjtanaa,
tlrmchlsmth,
yewentao256 and
zyongye
as code owners
August 13, 2026 04:13
akii96
force-pushed
the
perf/minimax-m3-index-score-split-k
branch
2 times, most recently
from
August 19, 2026 21:48
e01b44a to
3d46c15
Compare
akii96
force-pushed
the
perf/minimax-m3-index-score-split-k
branch
from
August 19, 2026 21:48
3d46c15 to
7b87e34
Compare
Signed-off-by: Aakif Nawaz <aakif.nawaz@amd.com>
akii96
force-pushed
the
perf/minimax-m3-index-score-split-k
branch
from
August 19, 2026 22:00
7b87e34 to
0598e29
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
MiniMax-M3 prefill computes index scores by scanning every visible 128-token index-K block for each query block.
The current gfx942 kernel uses 64 query tokens per program and processes the full K range in one loop. At long context lengths, this repeatedly loads index-K data and leaves insufficient parallel work for the GPU.
Suggested Fix
For gfx942 prefill with at least 128 query tokens and an 8K sequence length:
Each split writes a separate range of score columns, so no atomics or reduction pass are required. Other architectures and smaller shapes retain the existing 64-token, single-split configuration.
Test Plan
The test covers the existing short-context path and the gfx942 long-context split path. It compares every score written by the kernel, including causal masking, and verifies the final top-k block sets.
Serve command
Test Result
Kernel accuracy: 2/2 passed (short-context fallback + long-context split-K).
End-to-end serving on 4x MI325X (gfx942), TP4,
EmbeddedLLM/MiniMax-M3-FP8-dynamic, FP8 KV cache:Long-context prefill improvement scales with sequence length.
Short-context workloads are unaffected (selector falls back to unsplit path). Long-context prefill shows a consistent TTFT improvement.